﻿using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Syspetro.Core.Extensions;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace Syspetro.Core.DynamicApi
{
    [Serializable]
    [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class)]
    public class DynamicApiAttribute : Attribute, IApiDescriptionGroupNameProvider, IApiDescriptionVisibilityProvider
    {
        private string _Version = "V1";
        /// <summary>
        /// 版本
        /// </summary>
        public string Version
        {
            get { return _Version; }
            set { _Version = value; }
        }
        private bool _IsVisible = true;
        /// <summary>
        /// 接口是否可见
        /// </summary>
        public bool IgnoreApi
        {
            get { return _IsVisible; }
            set { _IsVisible = value; }
        }
        private string _Group = "DefultOpenApi";
        /// <summary>
        /// 分组
        /// </summary>
        public string GroupName
        {
            get { return _Group; }
            set { _Group = value; }
        }
        public string Title { get; set; }
        /// <summary>
        /// 分区
        /// </summary>
        public string Area { get; set; }
    }
}
